package com.example.warehousems.dao;

import com.example.warehousems.dao.model.Storage;
import com.example.warehousems.dao.model.StorageCoKey;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StorageRepository extends JpaRepository<Storage, StorageCoKey> {
    Storage findFirstByStatus(Integer status);
    @Query("select count(*) from Storage s")
    float getStorageCount();
    @Query("select count(s) from Storage s where s.status = 1")
    float getUsedStorageCount();
    Storage findByCargoId(Integer id);

    List<Storage> findNumberByShelfAndFloor(String shelf, Integer floor);
}
